<template>
  <div class="page-box">
    <el-pagination
      background
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page.sync="currentPage"
      :page-sizes="[10, 20, 50]"
      :page-size="size"
      layout="total,sizes,prev, pager, next, jumper"
      :total="sizes"
    ></el-pagination>
  </div>
</template>

<script>
export default {
  name: "pagination",
  props: {
    options: {
      type: Array,
      default: () => {
        return [];
      },
    },
    sizes: {
      // 总条数
      type: Number,
      default: 0,
    },
    size: {
      // 当前页多少条
      type: Number,
      default: 10,
    },
  },
  data() {
    return {
      currentPage: 1, // 第几页
      value: "",
    };
  },
  components: {},
  methods: {
    handleSizeChange(val) {
      // 多少条的变化
      this.$emit("sizeHandle", val);
    },
    handleCurrentChange(val) {
      // 第几页
      this.$emit("pageHandle", val);
    },
  },
  created() {},
};
</script>

<style lang="less" scoped>
.page-box {
  margin: 20px 0;
  padding: 10px 0;
  overflow: hidden;
  text-align: right;
  .el-pagination /deep/ {
    padding-top: 7px;
    .el-pager {
      font-size: 12px;
    }
    .el-pagination__total {
      font-size: 12px;
      margin-right: 1px;
    }
    .el-pagination__sizes {
      margin-right: 1px;
      .el-input__inner {
        font-size: 12px;
      }
    }
    .el-pagination__jump {
      font-size: 12px;
      margin-left: 5px;
    }
  }
  .is-background /deep/ {
    .btn-next,
    .btn-prev,
    .el-pager li {
      background-color: #ffffff;
    }
  }
}
</style>
